/*
 * File:   Task.cpp
 * Author: serena
 *
 * Created on 18 June 2013, 06:26
 */

#include "Task.h"
#include <QtCore/qstring.h>
#include <cassert>

Task::Task(QString name, int estimatedSlice) {
    assert(estimatedSlice > 0);
    this->name = name;

    this->estimatedSlice = estimatedSlice;
    this->completedSlice = 0;
    // TODO retrieve current date and set dueDate to "undefined"
}

Task::Task(QString name, int estimatedSlice, date_t dueDate) {
    this->name = name;
    // TODO assert dueDate > initDate; control this before!! (ui))
    this->dueDate = dueDate;

    // TODO some ways of calling the preceding constructor?
}

Task::Task(const Task& orig) {
}

Task::~Task() {
}

void Task::changeDueDate(date_t newDueDate) {
    // TODO assert newDueDate > initDate (ui??)
    dueDate = newDueDate;
}

void Task::changeEstimatedSlice(int newSlice) {
    assert(newSlice > 0);
    estimatedSlice = newSlice;
}

void Task::save() {

}

void Task::restore() {

}